function formatTime(date) {
  var year = date.getFullYear()
  var month = date.getMonth() + 1
  var day = date.getDate()

  var hour = date.getHours()
  var minute = date.getMinutes()
  var second = date.getSeconds()


  return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}

function formatNumber(n) {
  n = n.toString()
  return n[1] ? n : '0' + n
}
function DateDiff(t, e) {
  var a, r, n;
  return a = t.split("-"), r = new Date(a[1] + "-" + a[2] + "-" + a[0]), a = e.split("-"),
    n = new Date(a[1] + "-" + a[2] + "-" + a[0]), parseInt(Math.abs(r - n) / 1e3 / 60 / 60 / 24);
}
var getDistance = function(t, e, a, r) {
  t = t || 0, e = e || 0, a = a || 0, r = r || 0;
  var n = t * Math.PI / 180, o = a * Math.PI / 180, i = n - o, u = e * Math.PI / 180 - r * Math.PI / 180;
  return 12756274 * Math.asin(Math.sqrt(Math.pow(Math.sin(i / 2), 2) + Math.cos(n) * Math.cos(o) * Math.pow(Math.sin(u / 2), 2)));
}

module.exports = {
  formatTime: formatTime
}
var formatTime = function (t) {
  var e = t.getFullYear(), a = t.getMonth() + 1, r = t.getDate(), n = t.getHours(), o = t.getMinutes(), i = t.getSeconds();
  return [e, a, r].map(formatNumber).join("/") + " " + [n, o, i].map(formatNumber).join(":");
}
